import java.util.Arrays;

public class BubbleSort {
    public static void main(String[] args) {
        int []arr={23,9,328,4,43,2,6,46,34,6,54};
        String ret1= Arrays.toString(arr);
        System.out.println(ret1);
        bubbleSort(arr);
        String ret2=Arrays.toString(arr);
        System.out.println(ret2);
    }

    public static void bubbleSort(int []array){
        int i=0;
        int j=0;
        for(i=0;i<array.length-1;i++){
            for(j=0;j< array.length-i-1;j++){
                if(array[j]>array[j+1]){
                    int swap=array[j+1];
                    array[j+1]=array[j];
                    array[j]=swap;
                }
            }
        }

    }
}
